package com.hmall.gateway.filter;

import org.springframework.cloud.gateway.filter.GatewayFilter;
import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory;
import org.springframework.cloud.gateway.filter.factory.GatewayFilterFactory;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @Author:篍
 * @Date: 2025/09/06 9:12
 * @Description:
 */
@Component
//局部过滤器
public class JuBuGatewayFilterFactory extends AbstractGatewayFilterFactory<Object> implements Ordered {
    @Override
    public GatewayFilter apply(Object config) {
        return (exchange, chain) -> {
            System.out.println("JuBuGatewayFilterFactory");
            return chain.filter(exchange);
        };
    }

    @Override
    public int getOrder() {
        return Integer.MAX_VALUE;
    }
}
